<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<span id="${uuid}" style="display: none"></span>

<div data-id="accordion">
    <div title="选择工艺模板">
        <c:forEach items="${groups}" var="group">
            <div class="best-holder">
                <h3>${group.moduleName}</h3>

                <div class="lab-spr"></div>
                <div class="lab-box best-template">
                    <c:forEach items="${group.processTemplates}" var="template">
                        <dl data-id="lab-item" class="lab-item with-best" data-title="${template.processName}"
                            data-process-id="${template.id}"
                            data-record-total="${empty template.records ? 0 : fn:length(template.records)}"
                            data-href="${pageContext.request.contextPath}/app/api/process/detail?uuid=${uuid}&id=${template.id}">
                            <dt><img style="width: 64px;height: 64px"
                                     src="${pageContext.request.contextPath}/print/${template.processCover}"></dt>
                            <dd class="lab-name" data-id="lab-title"
                                title="${template.processName}">${template.processName}</dd>
                            <dd style="display: none">${template.remark}</dd>
                            <dd class="best-total">${template.bestTotal}</dd>
                        </dl>
                    </c:forEach>
                </div>
            </div>
        </c:forEach>
    </div>
    <div title="填写工艺参数">
        <div class="best-holder">
            <table style="width: 100%">
                <tr>
                    <td style="width: 60%;vertical-align: top">
                        <form data-id="parameterForm">
                            <div data-id="parameter">
                            </div>
                        </form>
                        <form data-id="baseForm">
                            <input name="tProcessTemplate.id" type="hidden" data-id="tProcessTemplate" value="${record.tProcessTemplate.id}"/>
                            <input name="id" type="hidden" data-id="tProcessTemplate" value="${id}"/>
                            <table border="1" cellpadding="0" cellspacing="0" class="hydra-table"
                                   style="margin-top: 20px;">
                                <tr class="hydra-tr-bg">
                                    <td class="hydra-left"><span class="nes-tip">*</span>推荐原因：</td>
                                    <td class="hydra-right"><textarea
                                            data-id="reason" name="reason"
                                            class="easyui-validatebox hydra-textarea hydra-input-width"
                                            draggable="false"
                                            data-options="required:true,validType:['normalChar','length[0,200]']"
                                            placeholder="填写推荐的原因..">${record.reason}</textarea></td>
                                </tr>
                            </table>
                            <div class="mt10" style="padding: 10px;">
                                <a href="javascript:void(0)" data-id="goToChooseProcess">重新选择模板</a>
                            </div>
                        </form>
                    </td>
                    <td style="width: 40%;vertical-align: top">
                        <div data-id="same-ebom" class="job-panel-wrap">
                            <div class="grid-wrap" style="margin-top: 0;min-height: 300px;">
                                <table data-id="grid"></table>
                            </div>
                            <div data-id="user_list_btn">
                                <a data-href="#" data-id="{{id}}" data-key="view" iconCls="fa fa-eye fa-lg"
                                   plain="true">查看</a>
                                <a data-href="#" data-id="{{id}}" data-key="use" iconCls="fa fa-share fa-lg"
                                   plain="true">应用该记录</a>
                            </div>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div>
<script language="javascript">
    seajs.use("apps/best/record", function (page) {
        page.update("${pageContext.request.contextPath}", "${uuid}", {
            templateId:"${record.tProcessTemplate.id}"
        });
    })
</script>

